#include<iostream>

using namespace std;
int a[10],i;
int main()
{ int n,k,ok=1;
  cout<<"introduceti nr de elemente ale vectorului: ";cin>>n;
  cout<<endl;
  cout<<"introduceti k: ";cin>>k;
  cout<<endl;
for(i=0;i<n;i++)
  { cout<<"a["<<i<<"]= ";
    cin>>a[i];
  }
for(i=0;i<n;i++)
    if(a[i]%k!=0) 
       a[i]=0;
cout<<"afiseaza elementele divizibile cu k: ";
for(i=0;i<n;i++)
   if(a[i]!=0) 
     cout<<a[i]<<" ";
   
} 
